package com.demo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.demo.entity.HotelOrder;
import com.demo.mapper.HotelOrderMapper;
import com.demo.service.HotelOrderService;
import org.springframework.stereotype.Service;

/**
 *  酒店预约service接口
 */
@Service
public class HotelOrderServiceImpl extends ServiceImpl<HotelOrderMapper, HotelOrder> implements HotelOrderService {
    @Override
    public HotelOrder getByUserId(Long userId) {
        LambdaQueryWrapper<HotelOrder> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(HotelOrder::getUserId, userId);
        return baseMapper.selectOne(queryWrapper);
    }
}
